---
title: Adding to an existing Rails app
description: This guide will show you how to add Spree to an existing Ruby on Rails application.
---

<Note>
If you followed the [Quickstart guide](quickstart) you can skip this page and go to the [Core Concepts](../core-concepts) section.
</Note>

## Overview

If you already have a Ruby on Rails application, you can add Spree to it by following these steps.

## 1. Installing Spree

<AccordionGroup>
   <Accordion icon="gem" title="Add Spree gems">
    Add these lines to your project `Gemfile`:

    ```ruby
    gem 'spree', '~> 4.7' # core and API
    gem 'spree_backend', '~> 4.7' # Admin panel (optional)
    gem 'spree_frontend', '~> 4.7' # Storefront (optional)
    gem 'spree_emails', '~> 4.7' # transactional emails (optional)
    gem 'spree_sample', '~> 4.7' # dummy data like products, taxons, etc (optional)
    gem 'spree_auth_devise', '~> 4.6' # Devise integration (optional)
    gem 'spree_gateway', '~> 3.11' # payment gateways eg. Stripe, Braintree (optional)
    ```

    And run the following command to install the gems:

    ```bash
    bundle install
    ```
  </Accordion>

  <Accordion icon="terminal" title="Run the install generators">
    These commands will run generators which will perform operations required for Spree to work properly.

    ```bash
    bin/rails g spree:install --user_class=Spree::User
    bin/rails g spree:backend:install
    bin/rails g spree:frontend:install
    bin/rails g spree:auth:install
    bin/rails g spree_gateway:install
    ```

    ### Installation options

    By default, the installation generator (`rails g spree:install`) will run migrations as well as adding seed. This can be disabled using

    ```bash
    bin/rails g spree:install --migrate=false --sample=false --seed=false
    ```

    You can always perform any of these steps later by using these commands.

    ```bash
    bin/rake railties:install:migrations
    bin/rails db:migrate
    bin/rails db:seed 
    ```
   </Accordion>

   <Accordion icon="box" title="Adding sample data">

    To add sample data to your store, run:

    ```bash
    bin/rake spree_sample:load
    ```

    This will add a some products, categories, and will setup a checkout flow to your store.
  </Accordion>
</AccordionGroup>

## 3. Exploring Your Store

Feel free to explore your store. You can do so because Spree comes with a default pre-built Storefront and Admin Panel.

<AccordionGroup>
  <Accordion icon="key" title="Logging into the Admin Dashboard">
    Use your browser window to navigate to [http://localhost:3000/admin](http://localhost:3000/admin). You can log in with the default credentials:
      - login: `spree@example.com`
      - password: `spree123`

    Upon successful authentication, you should see the admin screen:

    ![](/images/admin_panel_978-2x.jpg)

    Feel free to explore some of the Admin Panel features that Spree has to offer and to verify that your installation is working properly.
  </Accordion>

  <Accordion icon="palette" title="Browsing Storefront">
  
    Spree comes with a default pre-built Storefront. You can access it by navigating to [http://localhost:3000](http://localhost:3000).
    
    You can later customize this Storefront or choose another one if you prefer Next.js or Vue.js.

  </Accordion>
</AccordionGroup>

### All Done!

Congrats! You've set up your Spree Commerce and it's looking amazing! Need support or want to give some feedback? You can join our [community](https://slack.spreecommerce.org/) or drop us an email at [hello@spreecommerce.org](mailto:hello@spreecommerce.org).
